<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
<script>
	var ctx = "${ctx}";
</script>
<head>
<meta name="keywords"
	content="">
<meta name="description"
	content="">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="Wed, 26 Feb 209908:21:57 GMT">

<link href="${ctx}/static/css/bootstrap.min.css?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/font-awesome.min.css?v=4.4.0?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/animate.min.css?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/style.min.css?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/common.css?v=${static_version}" rel="stylesheet" />
	<link href="//at.alicdn.com/t/font_9x03jhokyws9vn29.css" rel="stylesheet">
	<!-- Data Tables -->
	<link href="${ctx}/static/css/plugins/dataTables/dataTables.bootstrap.css?v=${static_version}" rel="stylesheet" />
    
<title>优惠券使用情况</title>
</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content  animated fadeInRight">
	   	<div class="ibox float-e-margins">
	   	
	   	 <div class="ibox-title">
         	<h5>优惠券使用情况<small></small></h5>
         </div>
	   	
	   	<div class="ibox-content">
	   	
	   	<div class="row">
	    <form class="form-group" id="member_table_form" method="post" action="${ctx}/coupon_detail-list">	
		<input type="hidden" id="coupon_id" name="coupon_id" value='${u_coupon.coupon_id}' />	
		 
    		<div class="col-md-3">
				<div class="input-group">
					<span class="input-group-addon">订单类型：</span>							
					<select name="coupon_cate_id" 
						class="form-control">
						<option value="-1">--全部--</option>
						<option value="0"
							<c:if test="${coupon_cate_id==0}">selected</c:if>>美食</option>
						<option value="1"
							<c:if test="${coupon_cate_id==1}">selected</c:if>>购物</option>
					</select>
				</div>
			</div>
			<div class="col-md-3">
				<div class="input-group">
					<span class="input-group-addon">优惠金额：</span>	
					<select name="coupon_amout"
						class="form-control">
						<option value="-1">--不限--</option>
						<c:forEach items="${u_coupon_amount}" var="coupon_list">					
							<option value="${coupon_list.COUPON_AMOUT}" <c:if test="${coupon_amout == coupon_list.COUPON_AMOUT}">selected</c:if>>						
								${coupon_list.COUPON_AMOUT}元
							</option>
						</c:forEach>
					</select>
				</div>
			</div>	
			
				<%-- <div class="col-md-3">	
					<div class="input-group">	
						<span class="input-group-addon">时间段：</span>
						<input type="text" class="input-md form-control layer-date" name="sdate" id="sdate" value="${sdate}"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">													
					</div>
				</div>
				<div class="col-md-3">
					<div class="input-group">	
						<span class="input-group-addon">至：</span>	
						<input type="text" class="input-md form-control layer-date" name="edate" id="edate" value="${edate}"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">
					</div>
				</div>	 --%>
				<div class="col-md-5">		
					<label class="col-md-3 col-sm-3">时间段：</label>
					<div class="col-md-9 col-sm-9">
						<div class="input-daterange input-group">
							<input id="sdate" name="sdate" type="text" class="input-md form-control layer-date" placeholder="开始时间" onclick="new WdatePicker()"> <span class="input-group-addon">至</span>
							<input id="edate" name="edate" type="text" class="input-md form-control layer-date" placeholder="结束时间" onclick="new WdatePicker()">
						</div>														
					</div>													
				</div>
									
			 	<div class="col-md-1 col-sm-1">
					<button name="" id="" class="btn btn-primary radius" type="submit">查询</button>								
				</div>
								
				
		</form>		
		</div>
		
		<div class="hr-line-dashed3"></div>
        	<div class="formControls cl-2"><h5>已使用：${usenum}张 ,  未使用：${surplusnum}张</h5></div>
        <div class="hr-line-dashed3"></div>
		
		
			<table data-datatable="true"
				class="table table-striped table-bordered table-hover dataTables-example">
				<thead>
					<tr >
	                    <th class="text-center">用户名</th>
	                    <th class="text-center">使用时间</th>                        
	                    <th class="text-center">实用款</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${u_coupon_details}" var="u_coupon_detail">				
					<tr class="text-c">                   
						<td class="text-center">${u_coupon_detail.C_NICK}</td>
						<td class="text-center">${u_coupon_detail.USE_TIME}</td>
						<td class="text-center">${u_coupon_detail.BALANCE_PRICE}</td>
					</tr>
					</c:forEach>
				</tbody>
			</table>
		
	</div>
	
</div>
</div>	
	<script src="${ctx}/static/js/jquery.min.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/bootstrap.min.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/plugins/layer/layer.js?v=${static_version}"></script>
		<script
		src="${ctx}/static/js/plugins/dataTables/jquery.dataTables.js?v=${static_version}"></script>
	<script
		src="${ctx}/static/js/plugins/dataTables/dataTables.bootstrap.js?v=${static_version}"></script>

	<script type="text/javascript">
	$(document).ready(function() {
		$(".dataTables-example").dataTable();
	});
		
	function get_amount_list(coupon_cate_id){		
		$.ajax({
			type : "POST",
			url : "${ctx}/coupon_detail_amount-list",
			data : "coupon_cate_id=" + coupon_cate_id,
			error : function() {
				layer.msg('操作失败', {icon:5,time:1000});
			},
			success : function(msg) {
				alert(msg);
				
			}
		});
	}

	</script>
</body>
</html>



